package com.coderman.daotest.csdn.bean;

import com.coderman.daoclient.annotations.ColId;
import com.coderman.daoclient.annotations.Column;
import com.coderman.daoclient.annotations.Table;

import java.util.Date;

/**
 * Created by ${fanchunshuai} on 2017-8-10.
 *
 * @version: V1.0
 * @Desc:
 * @Copyright (c) 2017 58到家-版权所有
 */
@Table(name = "csdn_user")
public class CsdnUserEntity implements Comparable<CsdnUserEntity> {
    @ColId
    @Column(name = "id")
    private Long id;

    @Column(name = "user_name")
    private String userName;

    @Column(name = "nick_name")
    private String nickName;

    @Column(name = "guanzhu")
    private Integer guanZhu;

    @Column(name = "fans")
    private Integer fans;

    @Column(name = "address")
    private String address;

    @Column(name = "work_job")
    private String workJob;

    @Column(name = "major_job")
    private String majorJob;

    @Column(name = "blog_name")
    private String blogName;

    @Column(name = "blog_title")
    private String blogTitle;


    @Column(name = "create_time")
    private Date createTime;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getGuanZhu() {
        return guanZhu;
    }

    public void setGuanZhu(Integer guanZhu) {
        this.guanZhu = guanZhu;
    }

    public Integer getFans() {
        return fans;
    }

    public void setFans(Integer fans) {
        this.fans = fans;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getWorkJob() {
        return workJob;
    }

    public void setWorkJob(String workJob) {
        this.workJob = workJob;
    }

    public String getMajorJob() {
        return majorJob;
    }

    public void setMajorJob(String majorJob) {
        this.majorJob = majorJob;
    }

    public String getBlogName() {
        return blogName;
    }

    public void setBlogName(String blogName) {
        this.blogName = blogName;
    }

    public String getBlogTitle() {
        return blogTitle;
    }

    public void setBlogTitle(String blogTitle) {
        this.blogTitle = blogTitle;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "CsdnUserEntity{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", nickName='" + nickName + '\'' +
                ", guanZhu=" + guanZhu +
                ", fans=" + fans +
                ", address='" + address + '\'' +
                ", workJob='" + workJob + '\'' +
                ", majorJob='" + majorJob + '\'' +
                ", blogName='" + blogName + '\'' +
                ", blogTitle='" + blogTitle + '\'' +
                ", createTime=" + createTime +
                '}';
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CsdnUserEntity that = (CsdnUserEntity) o;

        if (userName != null ? !userName.equals(that.userName) : that.userName != null){
            return false;
        }
        if (nickName != null ? !nickName.equals(that.nickName) : that.nickName != null) {
            return false;
        }
        if (guanZhu != null ? !guanZhu.equals(that.guanZhu) : that.guanZhu != null) {
            return false;
        }
        if (fans != null ? !fans.equals(that.fans) : that.fans != null){
            return false;
        }
        if (address != null ? !address.equals(that.address) : that.address != null){
            return false;
        }
        if (workJob != null ? !workJob.equals(that.workJob) : that.workJob != null){
            return false;
        }

        if (majorJob != null ? !majorJob.equals(that.majorJob) : that.majorJob != null){
            return false;
        }
        if (blogName != null ? !blogName.equals(that.blogName) : that.blogName != null){
            return false;
        }
        if (blogTitle != null ? !blogTitle.equals(that.blogTitle) : that.blogTitle != null) {
            return false;
        }
        return true;

    }

    @Override
    public int hashCode() {
        int result = 0;
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        result = 31 * result + (nickName != null ? nickName.hashCode() : 0);
        result = 31 * result + (guanZhu != null ? guanZhu.hashCode() : 0);
        result = 31 * result + (fans != null ? fans.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (workJob != null ? workJob.hashCode() : 0);
        result = 31 * result + (majorJob != null ? majorJob.hashCode() : 0);
        result = 31 * result + (blogName != null ? blogName.hashCode() : 0);
        result = 31 * result + (blogTitle != null ? blogTitle.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        return result;
    }

    @Override
    public int compareTo(CsdnUserEntity o) {
        return this.getId() > o.getId() ? 1:-1;
    }
}
